home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / STRSET.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  741b  |  47 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; strset- Copies the character in al over the top of each character in the
  10. ;      string the es:si points at.  Does not affect the trailing zero
  11. ;      byte in the string.
  12. ;
  13. ; inputs:
  14. ;
  15. ;    AL-    Character to copy.
  16. ;    ES:DI-  Points at string to overwrite.
  17. ;
  18. ;
  19. ;
  20. ;
  21.         public    sl_strset
  22. ;
  23. sl_strset    proc    far
  24.         pushf
  25.         push    di
  26.         push    ax
  27. ;
  28.         cld
  29.         mov    ah, 0            ;Zero terminating byte
  30.         jmp    short StartLp
  31. ;
  32. SetLp:        stosb                ;Store next char
  33. StartLp:    cmp    ah, es:[di]        ;End of string?
  34.         jnz    SetLp
  35. ;
  36.         pop    ax
  37.         pop    di
  38.         popf
  39.         ret
  40. sl_strset    endp
  41. ;
  42. ;
  43. ;
  44. ;
  45. stdlib        ends
  46.         end
  47.